package com.onpositive.data.diskstorage;

import com.onpositive.data.IPropertyConstants;
import com.onpositive.data.IPropertyMetadata;
import com.onpositive.data.units.Unit;

public class MetadataFactory {

	public static IPropertyMetadata createScalarMeta(String id) {
		StoredMetadata ms = new StoredMetadata();
		ms.setId(id);
		ms.setVlaue(IPropertyConstants.CHAR_PARSER_ID_LABEL,
				IPropertyConstants.PROP_KIND_SCALAR);
		return ms;
	}

	public static IPropertyMetadata createDimension(String id, String unit) {
		StoredMetadata ms = new StoredMetadata();
		ms.setId(id);
		ms.setVlaue(IPropertyConstants.CHAR_PARSER_ID_LABEL,
				IPropertyConstants.PROP_KIND_DIMENSION);

		ms.setVlaue(IPropertyConstants.CHAR_UNIT_LABEL, unit);
		return ms;
	}

	public static IPropertyMetadata createDimension(String id, Unit un) {
		StoredMetadata ms = new StoredMetadata();
		ms.setId(id);
		ms.setVlaue(IPropertyConstants.CHAR_PARSER_ID_LABEL,
				IPropertyConstants.PROP_KIND_DIMENSION);

		ms.setVlaue(IPropertyConstants.CHAR_UNIT_LABEL, un.getShortName());
		ms.setVlaue(IPropertyConstants.CHAR_UNIT_KIND_LABEL, un.getKind()
				.name());
		return ms;
	}

	public static IPropertyMetadata createDate(String id) {
		StoredMetadata ms = new StoredMetadata();
		ms.setId(id);
		ms.setVlaue(IPropertyConstants.CHAR_PARSER_ID_LABEL,
				IPropertyConstants.PROP_KIND_DATE);
		return ms;
	}

	public static IPropertyMetadata createString(String id) {
		StoredMetadata ms = new StoredMetadata();
		ms.setId(id);
		ms.setVlaue(IPropertyConstants.CHAR_PARSER_ID_LABEL,
				IPropertyConstants.PROP_KIND_STRING);
		return ms;
	}
}
